'use strict';

const Controller = require('egg').Controller;

class ListController extends Controller {
    async index() {
        var {
            ctx
        } = this;
        console.log(ctx.params);
        var {
            m
        } = ctx.params;
        var res = await ctx.service.movie.find(m);
        if (res.length) {
            ctx.body = {
                status: 200,
                mgs: m,
                res,
            }
        } else {
            ctx.status = 400;
            ctx.body = {
                status: 400,
                msg: "输入的参数不合法"
            }
        }

    }
}

module.exports = ListController;